package com.edu.simplechatroom.entity;

import java.text.SimpleDateFormat;
import java.util.Date;


public class Message {
	private Date date;
	private String mess;
	private String name;
	private static final SimpleDateFormat sdf;
	
	
	static{
		sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	}
	
	public Message() {}
	
	public Message(Date date,String name,String mess){
		this.date  = date;
		this.name = name;
		this.mess = mess;
	}

	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public String getMess() {
		return mess;
	}

	public void setMess(String mess) {
		this.mess = mess;
	}

	@Override
	public String toString() {
		return "Message [date=" + sdf.format(date) + ", name=" + name + ", mess=" + mess  + "]";
	}
	

	
}
